<template>
  <div class="shopcart-sticky" v-show="visible">
    <Shopcart
      ref="shopcart"
      :selectFoods="selectFoods"
      :deliveryPrice="deliveryPrice"
      :minPrice="minPrice"
      :fold="fold"
      :sticky="true"></Shopcart>
  </div>
</template>

<script>
import Shopcart from 'components/shopcart/Shopcart.vue'

import popupMixin from 'common/mixins/popup'

export default {
  name: 'ShopcartSticky',
  mixins: [popupMixin],
  components: {
    Shopcart
  },
  props: {
    selectFoods: {
      type: Array,
      default () {
        return []
      }
    },
    deliveryPrice: {
      type: Number,
      default: 0
    },
    minPrice: {
      type: Number,
      default: 0
    },
    fold: {
      type: Boolean,
      default: true
    },
    list: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  methods: {
    drop (el) {
      this.$refs.shopcart.drop(el)
    }
  }
}
</script>

<style lang="stylus" scoped>
.shopcart-sticky
  position: absolute
  left: 0
  bottom: 0
  z-index: 999
  width: 100%
  height: 48px
</style>
